<?php

/**
 * This is the model class for table "tbl_CustomerCSIRelation".
 *
 * The followings are the available columns in table 'tbl_CustomerCSIRelation':
 * @property integer $customerID
 * @property string $csiAccount
 * @property string $aniPhoneNumber
 * @property boolean $Is_DisableView
 * @property integer $id
 *
 * The followings are the available model relations:
 * @property TblCustomer $customer
 */
class TblCustomerCSIRelation
{
	/**
	 * methodDescription.
	 *
	 * @return returnType returnDescription
	 */
	public static function isPhoneExists($phone) {
		
		$db = Yii::app()->enticedb;
		$sql = "SELECT COUNT(*) FROM POST3.ep_to_user_def WHERE value='$phone' and CUST_ID ='".CGlobal::$wsCustID."'";
		$count = $db->createCommand($sql)->queryScalar();
	  
		if($count == 0)
		{
			return false;
		}
		else 
		{
			return true;
		}
	}
}